home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / etc / httpd / cgi-bin / view-source < prev   
Encoding:
Text File  |  1994-03-09  |  506 b   |  24 lines

  1. #!/bin/sh
  2.  
  3.  
  4. # Script usage: http://yourserver/htbin/view-source/dir1/foo.c
  5. # This will send back the document $DOCUMENT_ROOT/dir1/foo.c as
  6. # plaintext. $DOCUMENT_ROOT is an env. variable set by the server.
  7.  
  8. if [ $# = 1 ]; then
  9.     echo Content-type: text/plain
  10.     echo
  11.     cat $DOCUMENT_ROOT/$1
  12. else 
  13.     echo Content-type: text/html
  14.     echo
  15.     cat << EOM 
  16. <TITLE>Source viewer</TITLE>
  17. <H1>Source Viewer</H1>
  18.  
  19. This script is a simple way to use the extra-path feature of scripts. You
  20. should not call it directly.
  21.  
  22. EOM
  23. fi
  24.